import time
from selenium.webdriver.chrome import webdriver
d=webdriver.WebDriver()
d.get('http://192.168.177.128/index.php')
d.maximize_window()
time.sleep(1)
dl=d.find_element_by_link_text('登录')
dl.click()
un=d.find_element_by_name('username')
un.send_keys('老蒯')
mm=d.find_element_by_name('password')
mm.send_keys('123456')
time.sleep(2)
an=d.find_element_by_name('submit')
an.click()
time.sleep(5)
zh=d.find_element_by_link_text('我的账户')
zh.click()
time.sleep(1)
ly=d.find_element_by_link_text('我的留言')
ly.click()
time.sleep(1)
zt=d.find_element_by_name('msg_title')
zt.click()
zt.send_keys('差评')
time.sleep(2)
llnr=d.find_element_by_name('msg_content')
llnr.click()
llnr.send_keys('商品杨豪雨实物与照片不符')
time.sleep(2)
wj=d.find_element_by_name('message_img')
#上传文件，r+文件地址
wj.send_keys(r'D:\work\coding\autowebtest\venv\微信图片_20251024102938.jpg')
tj=d.find_element_by_xpath('//input[@type="submit" and @class="bnt_bonus"]')
tj.click()


